const Joi = require("joi");

const id = Joi.number().integer().min(1).required();
const name = Joi.string().min(1).max(20).required();
const nickname = Joi.string().min(1).max(20);
const country = Joi.number().integer().valid(0, 1, 2, 3);
const gender = Joi.number().integer().valid(0, 1, 2);
const intro = Joi.string().min(1).max(500);

//新增数据验证
exports.add_Schema = {
	body: {
		name,
		nickname,
		gender,
		intro,
		country,
	}
};

// 更新数据
exports.update_Schema = {
	body: {
		id,
		name,
		nickname,
		gender,
		intro,
		country
	}
};    